var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var mineService = require('../../app/services/mineService');
var dataApi = require('../../app/libs/dataApi');
var config = require('../config');

suite('测试mineService', function () {
    suite('getCanGainGold', function () {
        test('相应的时间内能收取到的粮食数量', function () {
            mineService.getCanGainGold(1, 1, 1000).gain_gold.should.equal(0);
            mineService.getCanGainGold(1, 100, 1000).gain_gold.should.equal(5);
            mineService.getCanGainGold(1, 100, 1).gain_gold.should.equal(1);
            mineService.getCanGainGold(1, 3600, 1000000).gain_gold.should.equal(200);
            mineService.getCanGainGold(1, 1000000, 1).gain_gold.should.equal(1);
        });
    });

    suite('getCanGainGoldEverySecond', function () {
        test('获取每秒能收的粮食', function () {
            mineService.getCanGainGoldEverySecond(1).should.equal(0.05555555555555555);

        });
    });

    suite('getGainGoldNeedSecond', function () {
        test('获取相应的食物需要多少秒回复', function () {
            mineService.getGainGoldNeedSecond(1, 150).should.equal(2700);
        });
    });
});
